import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);

export default new Router({
    routes: [
        {
            path: '/',
            redirect: '/dashboard'
        },
        {
            path: '/',
            component: resolve => require(['../components/common/Home.vue'], resolve),
            meta: { title: '系统管理' },
            children:[
                {
                    path: '/dashboard',
                    component: resolve => require(['../components/page/Dashboard/index.vue'], resolve),
                    meta: { title: '系统首页', noclose: 1 }
                },{
                    path: '/sys/account',
                    component: resolve => require(['../components/page/sys/account/index.vue'], resolve),
                    meta: { title: '账号管理' },
                },{
                    path: '/sys/organization',
                    component: resolve => require(['../components/page/sys/organization/index.vue'], resolve),
                    meta: { title: '组织结构' },
                },{
                    path: '/sys/role',
                    component: resolve => require(['../components/page/sys/role/index.vue'], resolve),
                    meta: { title: '角色管理' },
                },{
                    path: '/sys/config',
                    component: resolve => require(['../components/page/sys/config/index.vue'], resolve),
                    meta: { title: '字典配置' },
                },{
                    path: '/sys/module',
                    component: resolve => require(['../components/page/sys/module/index.vue'], resolve),
                    meta: { title: '权限模块' },
                },{
                    path: '/sys/dblog',
                    component: resolve => require(['../components/page/sys/dblog/index.vue'], resolve),
                    meta: { title: '系统日志' },
                },{
                    path: '/sys/micsrv',
                    component: resolve => require(['../components/page/sys/micsrv/index.vue'], resolve),
                    meta: { title: '服务发现' },
                },{
                    path: '/sys/yamlfile',
                    component: resolve => require(['../components/page/sys/yamlfile/index.vue'], resolve),
                    meta: { title: '服务配置' },
                },{
                    path: '/sys/payment',
                    component: resolve => require(['../components/page/sys/payment/index.vue'], resolve),
                    meta: { title: '业务参数' },
                },{
                    path: '/social/travel',
                    component: resolve => require(['../components/page/social/travel/index.vue'], resolve),
                    meta: { title: '日历管理' },
                },{
                    path: '/social/star',
                    component: resolve => require(['../components/page/social/star/index.vue'], resolve),
                    meta: { title: '明星管理' },
                },{
                    path: '/social/tags',
                    component: resolve => require(['../components/page/social/tags/index.vue'], resolve),
                    meta: { title: '标签管理' },
                }
            ]
        },{
            path: '/login',
            component: resolve => require(['../components/page/Login.vue'], resolve)
        },{
            path: '/404',
            component: resolve => require(['../components/page/404.vue'], resolve)
        },{
            path: '/403',
            component: resolve => require(['../components/page/403.vue'], resolve)
        },{
            path: '*',
            redirect: '/404'
        }
    ]
})
